package com.google.code.garbagecan.springbatchstudy.message;

import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.item.file.transform.FieldSet;
import org.springframework.validation.BindException;

public class UserMapper implements FieldSetMapper<User> {
	public User mapFieldSet(FieldSet fieldSet) throws BindException {
		User user = new User();
		user.setId(fieldSet.readString(0));
		user.setName(fieldSet.readString(1));
		user.setSex(fieldSet.readInt(2));
		return user;
	}
}